home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Demos
/
A.D. Software
/
OOFILE
/
Buildable, limited OOFILE
/
samples
/
ooftst04.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-02-07
|
1KB
|
49 lines
// Copyright 1994 A.D. Software. All Rights Reserved
// OOFTEST4
// this sample just demonstrates the report-writer
// Simple stream I/O is used to interact with the user.
#include "oofile.hpp"
#include "oofrw.hpp"
#include "ooftst02.inc"
int main()
{
cout << "OOFILE Validation Suite - Test 4\n"
<< "Simple test to demonstrate use of the report-writer" << endl
<< "using the database from ooftest2 and output to a file" << endl;
if (dbConnect::fileExists("ooftst02.db"))
theDB.openConnection("ooftst02.db");
else {
theDB.newConnection("ooftst02.db");
Patients.AddTestData();
}
Patients.setSortOrder(Patients.LastName);
cout << "Listing records to ooftst04.out...";
ofstream fs("ooftst04.out");
dbView theView(Patients);
theView << Patients.PatientNo << Patients.LastName << Patients.Salary;
dbRepChar tempReport(dbRepSizer("Demo Columnar Report").pageHeight(80),
dbRepColWidths() << 8 << 10 << 30, theView);
tempReport.draw(fs);
fs << endl << endl << "Repeating the report with the same data view"<< endl << endl;
dbRepChar tempReport2(dbRepSizer("Demo Columnar Report").pageHeight(80),
theView, dbRep::pageWise);
tempReport2.draw(fs);
fs.close();
cout << "done" << endl;
return EXIT_SUCCESS;
}